package com.android.equipment.adapter

import com.android.equipment.R
import com.android.equipment.dao.HistoryAlam
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class HistoryAlamAdapter(layoutRes: Int): BaseQuickAdapter<HistoryAlam, BaseViewHolder>(layoutRes) {
    override fun convert(holder: BaseViewHolder, item: HistoryAlam) {
        holder.setText(R.id.tv_alam_device,"${item.device_name}(${item.device_code})")
        holder.setText(R.id.tv_alam_people, item.people_name)
        holder.setText(R.id.tv_alam_node, item.node_des)
        holder.setText(R.id.tv_alam_time, item.alam_time)
        if (item.recover_time.isNullOrEmpty()){
            holder.setGone(R.id.tv_recover_time,true)
        }else {
            holder.setGone(R.id.tv_recover_time,false)
        }
        holder.setText(R.id.tv_recover_time, item.recover_time)
    }
}